{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "from sklearn.metrics import classification_report\n",
    "from sklearn import preprocessing\n",
    "from sklearn.preprocessing import PolynomialFeatures\n",
    "# 数据是否需要标准化\n",
    "scale = False"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYYAAAD8CAYAAABzTgP2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJztnX2wHVW14H8r5Ksi0XwBBpJ7bxjy\nkI+QACkQsVRQPvQPwoxR4AUNAnULtCCF+opg3jMp5lFP3qtnDIOORuARyX3IkCkgM6OFfDn8Iag3\nTiCAE5KQDy/JgxAIT8wAIXfNH92d9Dk5H33O2d29u8/6VXWd7t27u9fZp89ee6+199qiqhiGYRhG\nxIi8BTAMwzD8whSDYRiGUYEpBsMwDKMCUwyGYRhGBaYYDMMwjApMMRiGYRgVmGIwDMMwKjDFYBiG\nYVRgisEwDMOoYGTeArTDlClTtK+vL28xDMMwCsW6deveUNWjmuUrpGLo6+tjcHAwbzEMwzAKhYhs\nT5LPTEmGYRhGBaYYDMMwjApMMRiGYRgVFNLHYBiGUYv9+/czNDTEu+++m7couTJ27FimTZvGqFGj\n2rreFINhGKVhaGiI8ePH09fXh4jkLU4uqCp79uxhaGiIGTNmtHUPMyUZhlEa3n33XSZPnty1SgFA\nRJg8eXJHvSZTDIZhlIpuVgoRnZaBKQajFAwMQF8fjBgRfA4M5C2RYRQXUwxG4RkYgP5+2L4dVIPP\n/n5TDkY+HHnkkQ3Pb9u2jVNPPbWle1511VWsWbMGgK1bt3L22Wczc+ZMLrvsMt5///22Za2HKQaj\n8CxZAvv2Vabt2xeklxHrHXU3N998MzfddBObNm1i4sSJ3H333c6fYYrBKDw7drSWXmSsd+SWNJXs\nO++8w2c/+1nOOOMMZs2axSOPPHLw3AcffMDChQs57bTTmD9/PvvCls26dev49Kc/zZlnnslFF13E\nrl27Ku6pqjz55JPMnz8fgIULF/Lwww+7EzrEFINReHp6WksvMt3WO0qTtJXs2LFjeeihh/jDH/7A\nU089xbe+9S1UFYCNGzfS39/P888/z4c//GF+9KMfsX//fm644QbWrFnDunXruPrqq1lS9cPu2bOH\nCRMmMHJkMNNg2rRpvPrqq24EjmHzGIzCc9ttwR86XmGOGxekl41u6h2lTSMlu2BB5/dXVb7zne/w\n9NNPM2LECF599VVee+01AKZPn865554LwJVXXskdd9zBxRdfzAsvvMAFF1wAwIEDB5g6deph96wm\njVFYphiMwhP9iZcsCSrInp5AKbj4c/tGT0/Qsq2VbrRG2kp2YGCA3bt3s27dOkaNGkVfX9/BuQXV\nlbmIoKqccsopPPPMM3XvOWXKFPbu3csHH3zAyJEjGRoa4thjj3UjcAwzJRmlYMEC2LYNhoeDzzIq\nBQgU3rhxlWll7R2lTdomyLfffpujjz6aUaNG8dRTT7E9ptF37NhxUAHcf//9fPKTn+TEE09k9+7d\nB9P379/Piy++WHFPEeG88847OEJp1apVzJs3z43AMUwxGEaBWLAAVq6E3l4QCT5XriyvIkyTtJXs\nggULGBwcZO7cuQwMDPCxj33s4LmTTjqJVatWcdppp/Hmm29y/fXXM3r0aNasWcPNN9/M7NmzmTNn\nDr/5zW8Ou+/tt9/O97//fU444QT27NnDNddc40bgGFLLZuU7c+fOVVuoxzCMav74xz9y0kknJc4/\nMFBeE2StshCRdao6t9m1TnoMInKPiLwuIi/UOS8icoeIbBaR50XkjNi5hSKyKdwWupDHMAwjCd1i\ngmwVV6ake4GLG5z/PDAz3PqB/wogIpOApcDZwFnAUhGZ6EimrsImPbWGlZ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+4BOhDM+Fn9fErj+eoHLb\nDDwIjMlYtiuB/cD62DYnzbIjGP3xMkFrcEmYditBZQswNiyLzWHZHB+7dkl43Ubg8ym8b81kexx4\nLVZWa5v9xhnL9w/Ai6EcTwEfi117dVimm4Gv5SFfeLwM+F7VdamXH0GjcVf4vg8R+IiuA64Lzwvw\nw1D2DcDcLMuu2WYznw3DMIwKzJRkGIZhVGCKwTAMw6jAFINhGIZRgSkGwzAMowJTDIZhGEYFphgM\nwzCMCkwxGIZhGBWYYjAMwzAq+P+fiPI+Jua50QAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x254d54a16d8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 载入数据\n",
    "data = np.genfromtxt(\"LR-testSet2.txt\", delimiter=\",\")\n",
    "x_data = data[:,:-1]\n",
    "y_data = data[:,-1,np.newaxis]\n",
    "    \n",
    "def plot():\n",
    "    x0 = []\n",
    "    x1 = []\n",
    "    y0 = []\n",
    "    y1 = []\n",
    "    # 切分不同类别的数据\n",
    "    for i in range(len(x_data)):\n",
    "        if y_data[i]==0:\n",
    "            x0.append(x_data[i,0])\n",
    "            y0.append(x_data[i,1])\n",
    "        else:\n",
    "            x1.append(x_data[i,0])\n",
    "            y1.append(x_data[i,1])\n",
    "\n",
    "    # 画图\n",
    "    scatter0 = plt.scatter(x0, y0, c='b', marker='o')\n",
    "    scatter1 = plt.scatter(x1, y1, c='r', marker='x')\n",
    "    #画图例\n",
    "    plt.legend(handles=[scatter0,scatter1],labels=['label0','label1'],loc='best')\n",
    "    \n",
    "plot()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# 定义多项式回归,degree的值可以调节多项式的特征\n",
    "poly_reg  = PolynomialFeatures(degree=3) \n",
    "# 特征处理\n",
    "x_poly = poly_reg.fit_transform(x_data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "def sigmoid(x):\n",
    "    return 1.0/(1+np.exp(-x))\n",
    "\n",
    "def cost(xMat, yMat, ws):\n",
    "    left = np.multiply(yMat, np.log(sigmoid(xMat*ws)))\n",
    "    right = np.multiply(1 - yMat, np.log(1 - sigmoid(xMat*ws)))\n",
    "    return np.sum(left + right) / -(len(xMat))\n",
    "\n",
    "def gradAscent(xArr, yArr):\n",
    "    \n",
    "    if scale == True:\n",
    "        xArr = preprocessing.scale(xArr)\n",
    "    xMat = np.mat(xArr)\n",
    "    yMat = np.mat(yArr)\n",
    "    \n",
    "    lr = 0.03\n",
    "    epochs = 50000\n",
    "    costList = []\n",
    "    # 计算数据列数，有几列就有几个权值\n",
    "    m,n = np.shape(xMat)\n",
    "    # 初始化权值\n",
    "    ws = np.mat(np.ones((n,1)))\n",
    "    \n",
    "    for i in range(epochs+1):             \n",
    "        # xMat和weights矩阵相乘\n",
    "        h = sigmoid(xMat*ws)   \n",
    "        # 计算误差\n",
    "        ws_grad = xMat.T*(h - yMat)/m\n",
    "        ws = ws - lr*ws_grad \n",
    "        \n",
    "        if i % 50 == 0:\n",
    "            costList.append(cost(xMat,yMat,ws))\n",
    "    return ws,costList"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[ 4.16787292]\n",
      " [ 2.72213524]\n",
      " [ 4.55120018]\n",
      " [-9.76109006]\n",
      " [-5.34880198]\n",
      " [-8.51458023]\n",
      " [-0.55950401]\n",
      " [-1.55418165]\n",
      " [-0.75929829]\n",
      " [-2.88573877]]\n"
     ]
    }
   ],
   "source": [
    "# 训练模型，得到权值和cost值的变化\n",
    "ws,costList = gradAscent(x_poly, y_data)\n",
    "print(ws)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {
    "collapsed": false
   },
   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pMpn6sT7+BNqdAs\nImOAGmBoVxVGRHoDTwDVxpim8LctvsXR55r1AcAYc5oL1/D4/v5KRFbibZq7HgBcKOtGIPgJcH/A\nk+Q1LdmVVUQ2i8ggY0yDryn6VZRr+D/Xz0TkFbxPN6kOAE4+I/85G0WkB1BG13QXxCyrMebroJf3\nAXPTUK5Epe33M1nBlawxplZE/ldE9jXGpD1PkIgU4K38HzLGPGlxSsKfq3YBxSAiJSLSx/81cAZg\nOXMgA7wFDBWRISJSiHcAM22za4I8DVzq+/pSIKL1IiL9RKSn7+t9gROAD9JQNiefUXD5zwP+bHyj\nbWkWs6xhfb3n4O0jzlRPAxN8s1aOAxr9XYWZRkQG+sd9ROQYvHXl1/bflZJyCPB74ENjzB1RTkv8\nc+3qUe6u/AOMxxs9dwObgRd8xyuAWt/XB+OdfVEHrMfbHZORZTWdMwI+xvsk3VVl3Qf4E/CJ7+/+\nvuMjgft9X48C3vd9ru8Dl6exfBGfETAbOMf3dRHwR+BT4E3g4C78HY1V1t/5fi/rgL8A3+rCsj4C\nNAB7fb+rlwM/A37me1+Au3w/y/vYzLzLgLJeE/S5vg6M6qJy/hfe7py1wHu+P2Pc+lx1JbBSSuUo\n7QJSSqkcpQFAKaVylAYApZTKURoAlFIqR2kAUEqpHKUBQCmlcpQGAKWUylEaAJRSKkf9fwj7heRi\n8/SxAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x254d67a1320>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\n",
    "# 获取数据值所在的范围\n",
    "x_min, x_max = x_data[:, 0].min() - 1, x_data[:, 0].max() + 1\n",
    "y_min, y_max = x_data[:, 1].min() - 1, x_data[:, 1].max() + 1\n",
    "\n",
    "# 生成网格矩阵\n",
    "xx, yy = np.meshgrid(np.arange(x_min, x_max, 0.02),\n",
    "                     np.arange(y_min, y_max, 0.02))\n",
    "\n",
    "# np.r_按row来组合array， \n",
    "# np.c_按colunm来组合array\n",
    "# >>> a = np.array([1,2,3])\n",
    "# >>> b = np.array([5,2,5])\n",
    "# >>> np.r_[a,b]\n",
    "# array([1, 2, 3, 5, 2, 5])\n",
    "# >>> np.c_[a,b]\n",
    "# array([[1, 5],\n",
    "#        [2, 2],\n",
    "#        [3, 5]])\n",
    "# >>> np.c_[a,[0,0,0],b]\n",
    "# array([[1, 0, 5],\n",
    "#        [2, 0, 2],\n",
    "#        [3, 0, 5]])\n",
    "z = sigmoid(poly_reg.fit_transform(np.c_[xx.ravel(), yy.ravel()]).dot(np.array(ws)))# ravel与flatten类似，多维数据转一维。flatten不会改变原始数据，ravel会改变原始数据\n",
    "for i in range(len(z)):\n",
    "    if z[i] > 0.5:\n",
    "        z[i] = 1\n",
    "    else:\n",
    "        z[i] = 0\n",
    "z = z.reshape(xx.shape)\n",
    "\n",
    "# 等高线图\n",
    "cs = plt.contourf(xx, yy, z)\n",
    "plot() \n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "             precision    recall  f1-score   support\n",
      "\n",
      "        0.0       0.86      0.83      0.85        60\n",
      "        1.0       0.83      0.86      0.85        58\n",
      "\n",
      "avg / total       0.85      0.85      0.85       118\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# 预测\n",
    "def predict(x_data, ws):\n",
    "#     if scale == True:\n",
    "#         x_data = preprocessing.scale(x_data)\n",
    "    xMat = np.mat(x_data)\n",
    "    ws = np.mat(ws)\n",
    "    return [1 if x >= 0.5 else 0 for x in sigmoid(xMat*ws)]\n",
    "\n",
    "predictions = predict(x_poly, ws)\n",
    "\n",
    "print(classification_report(y_data, predictions))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "test = [[2,3]]\n",
    "# 定义多项式回归,degree的值可以调节多项式的特征\n",
    "poly_reg  = PolynomialFeatures(degree=3) \n",
    "# 特征处理\n",
    "x_poly = poly_reg.fit_transform(test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 1.,  2.,  3.,  4.,  6.,  9.,  8., 12., 18., 27.]])"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x_poly"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAD8CAYAAAB+UHOxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAEY9JREFUeJzt3X2sZHV9x/H3R1h8JILuIriwXU03\nrZhWoTdUpGloQYMby+IDDf5R0Wo2tpJqYppiSbT6T7UmNjFS7apEbIxQUXStaxF8CDUNyAVZYFmp\nK9Fw3Y1cwaIGqyx8+8c9a24ucx/2zrkzw/7er2Ryz5nzm/l++d2785lz5gwnVYUkqT1PGncDkqTx\nMAAkqVEGgCQ1ygCQpEYZAJLUKANAkhplAEhSowwASWqUASBJjTp63A0sZf369bV58+ZxtyFJTxi3\n3nrrT6pqw0rGTnQAbN68menp6XG3IUlPGEl+uNKxHgKSpEYZAJLUKANAkhplAEhSowwASWqUASBJ\njZro00BX4wvf+REfuO4efvS/v+SohEerCHA41z17UuCxwsdNUG0fN3m1j/THjbP28U9bx7v/7IVc\ncNrGw2v0MB1RAfCF7/yIv71mN488OjfVj3aXuzzcX/pj3QN83OTU9nGTV/tIf9w4a//04Ud4x2d3\nA6xpCBxRh4De86U9v3nxl6QnskcfK97zpT1rWuOICoCfPvzIuFuQpN6s9Wva0AGQ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W+vYi6tfwX8GLhuYW/MncGxu7vtmaTexjhvzwa+Bnyv+/ms7v4p4OPd8kuBO7t5uxN40xr2\n87g5AN7L3JsOgKcAn+3+Fr8NPH8U87TC3v6x+7vaDXwD+N0R9vYZ4ADwSPe39ibgLcBbuu0BLu96\nv5MlzpQbcV+XzJuzm4CXjnDO/oi5wzl3zHtN2zoJ8+Y3gSWpURN5CEiStPYMAElqlAEgSY0yACSp\nUQaAJDXKAJCkRhkAktQoA0CSGvX/yCJWeOmmRwMAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x254d66bd048>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 获取数据值所在的范围\n",
    "x_min, x_max = x_data[:, 0].min() - 1, x_data[:, 0].max() + 1\n",
    "y_min, y_max = x_data[:, 1].min() - 1, x_data[:, 1].max() + 1\n",
    "\n",
    "# 生成网格矩阵\n",
    "xx, yy = np.meshgrid(np.arange(x_min, x_max, 0.02),\n",
    "                     np.arange(y_min, y_max, 0.02))\n",
    "\n",
    "plt.scatter(xx,yy)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python [Root]",
   "language": "python",
   "name": "Python [Root]"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
